<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>canvas</title>
    <style>
    #canvas{
        display: block;
        margin: 0 auto;
        border: 1px solid #eee;
    }
    </style>
</head>
<body>
    <canvas id="canvas" width="400" height="300"></canvas>
    <script>
        /** @type {HTMLCanvasElement} */
        let canvas = document.querySelector('#canvas');
        let ctx = canvas.getContext('2d');
        let pointX = ctx.canvas.width/2;
        let pointY = ctx.canvas.height/2;
		
        // 顺时针  2*Math.PI 360度  最后一个参数，顺时针逆时针
        ctx.arc(pointX,pointY,100,0,2*Math.PI,false)
        ctx.stroke()
        ctx.beginPath()
        // 逆时针
		ctx.fillStyle="#0000ff";
        ctx.arc(pointX,pointY,50,0,1*Math.PI,true)
		ctx.fill();
        ctx.stroke()
    </script>
</body>
</html>